/**
 *This file contains all of the 'constants' for the Character Rigger script.
 *In reality, these aren't really constants but they are never changed.
 */

/**
 * The error object of all the errors defined for the Character Rigger script
 */
var errors =
{
    NO_OPEN_PROJECT: "You do not have a project open!",
    NO_ACTIVE_COMP : "You must have an active composition open or selected!",
    UI_UNKNOWN: "There was an unknown error building the UI",
    COULD_NOT_ADD_CHARACTER: "There was an error in adding your character's control to the composition.",
    COULD_NOT_ADD_CHARACTER_TO_TREE: "There was an error in adding the character to the tree.",
    COULD_NOT_CLEAR_CHARACTER_NAME: "There was an error clearing the character's name in the add character view",
    ADD_CHARACTER_UNKOWN: "An uknown error occurred while trying to add your character.",
    EDIT_CHAR_VIEW_ERROR: "An error occurred while trying to show the edit character view.",
    COULDNT_GET_CHARACTER_TO_EDIT: "An error occurred while trying to get the character to edit",
    EDIT_BP_VIEW_ERROR: "An error occurred while trying to show the edit body part view.",
    COULDNT_RENAME_CHARACTER_IN_TREE: "The item in the tree could not be renamed.",
    COULDNT_RENAME_CHARACTER: "The character could not be renamed.",
    COULDNT_GET_TREE_ITEM_FROM_LI_INDEX: "An error occured while trying to get the TreeItem from a ListItem index.",
    COULDNT_GET_TREEITEM_FROM_OBJID: "An error occured while trying to get the TreeItem from the Object Id.",
    COULDNT_GET_OBJECT_FROM_TREE: "An error occured while trying to get the Object from the Tree selection.",
    COULDNT_GET_TREE_ITEM_FROM_SELECTION: "An error occured while trying to get a TreeItem from the Tree selection.",
    COULDNT_LOAD_SUB_UIS: "Could not import Sub UIs.",
    COULDNT_PARSE_SUI: "The following Sub UI could not be parsed: ",
    COULDNT_SHOW_SUI: "The following Sub UI could not be shown: ",
    COULDNT_HIDE_SUI: "The following Sub UI could not be shown: "
}

/**
 * The TreeItem types. This tells the TreeItem object what type of object the
 * ListItem is paired to.
 */
var TreeItems = {
    CHARACTER: 1,
    BODYPART: 2
}

/**
 * The controller types
 */
var ControlTypes = {
    SLIDER: "Slider",
    CHECKBOX: "Checkbox",
    ROTATION: "Rotation",
    POINT: "Point",
    OPACITY_SLIDER: "Opacity Slider",
    INVERSE_ROTATION: "Inverse Rotation",
    INVERSE_OPACITY: "Inverse Opacity",
    LINK_INDIVIDUAL_XYZ: "Individual Demension Link",
    LINK_ALL_XYZ: "Separate XYZ",
    WALK_CYCLE: "Walk Cycle Setup"
}

/**
 * The help strings for each of the ControllerTypes
 */
var ControlTypesHelp = new Array();
ControlTypesHelp[ControlTypes.SLIDER]               = "This control creates a slider that moves a property's values from the value of its first keyframe to the value of its second keyframe.";
ControlTypesHelp[ControlTypes.CHECKBOX]             = "This control creates a checkbox that snaps a property's values from the value of its first keyframe or the value of its second keyframe.";
ControlTypesHelp[ControlTypes.ROTATION]             = "This control links its rotation with the body part's rotation property.";
ControlTypesHelp[ControlTypes.POINT]                = "This control links its X and Y values to the body part's x and y values. For X, Y and Z control, choose the \"Separate XYZ\" controller. This controller will only work on spacial properties.";
ControlTypesHelp[ControlTypes.OPACITY_SLIDER]       = "This control controls the opacity of an arbitrary amount of layers with each layer having its own portion of the slider where its opacity is on. Multiple layers must be selected.";
ControlTypesHelp[ControlTypes.INVERSE_ROTATION]     = "This control causes its body part to have the inverse rotation of another layer.";
ControlTypesHelp[ControlTypes.INVERSE_OPACITY]      = "This control causes its body part's opacity to be the oppocity of another layer.";
ControlTypesHelp[ControlTypes.LINK_INDIVIDUAL_XYZ]  = "This control parents any combination of its body part's X, Y and Z values with those of another layer.";
ControlTypesHelp[ControlTypes.LINK_ALL_XYZ]         = "This control parents its body part's X, Y and Z values to a 'Separate XYZ' effect.";
ControlTypesHelp[ControlTypes.WALK_CYCLE]           = "This control is the same as the 'Separate XYZ' effect except that it adds three preset keyframes on the Y property that simulate a 'bouncing walk cycle.'";

/**
 * Standard body parts and their default control type
 */
var StandardBodyParts = {
    EYES: ControlTypes.POINT,
    EYELIDS: ControlTypes.CHECKBOX,
    EYEBROWS: ControlTypes.SLIDER,
    HEAD: ControlTypes.SLIDER,
    RIGHT_SHOULDER: ControlTypes.SLIDER,
    RIGHT_FOREARM: ControlTypes.SLIDER,
    RIGHT_HAND: ControlTypes.SLIDER,
    LEFT_SHOULDER: ControlTypes.SLIDER,
    LEFT_FOREARM: ControlTypes.SLIDER,
    LEFT_HAND: ControlTypes.SLIDER,
    UPPER_BODY: ControlTypes.SLIDER,
    BODY: ControlTypes.SLIDER,
    LEFT_LEG: ControlTypes.SLIDER,
    LEFT_SHIN: ControlTypes.SLIDER,
    LEFT_FOOT: ControlTypes.SLIDER,
    RIGHT_LEG: ControlTypes.SLIDER,
    RIGHT_SHIN: ControlTypes.SLIDER,
    RIGHT_FOOT: ControlTypes.SLIDER
}

/**
 * Standard body part names
 */
var StandardBodyPartNames = new Object;
var kString = "";
for(key in StandardBodyParts)
{
    kString = key.toString();
    kString = kString.replace("_", " ");
    StandardBodyPartNames[key] = kString.substr(0, 1).toUpperCase() + kString.substr(1, kString.length).toLowerCase();
}
kString = undefined;